﻿<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <title>call用法</title>
    <script>
    function Animal() {
        this.showSub = function(a, b) {
            console.log(a - b);
        }
    }

    function Cat() {
        this.showAdd = function(a, b) {
            console.log(a + b);
        }
    }

    function Dog() {
        Animal.call(this);
        Cat.call(this);
    }

    var a = new Dog();
    a.showSub(5,3);
    a.showAdd(5,3);
    </script>
</head>

<body>
</body>

</html>